import 'package:flutter/material.dart';

class MineFuncButton extends StatelessWidget {
  final String _name;
  final String _title;
  final Function _onTap;

  MineFuncButton({
    Key key,
    String name,
    String title,
    @required Function onTap,
  })  : _name = name ?? 'assets/images/mine/ic_func_score.png',
        _title = title ?? '未设置',
        _onTap = onTap,
        super(key: key);

  @override
  Widget build(BuildContext context) {
    return InkWell(
      borderRadius: BorderRadius.circular(4),
      child: Container(
        child: Column(
          mainAxisAlignment: MainAxisAlignment.center,
          children: [
            Image.asset(_name, width: 50),
            SizedBox(height: 4),
            Text(
              _title,
              style: TextStyle(
                color: Color(0xFF494747),
                fontSize: 12,
                fontWeight: FontWeight.bold,
              ),
            ),
          ],
        ),
      ),
      onTap: _onTap,
    );
  }
}
